package com.gxa.controller;

import com.gxa.common.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: wangyifan
 * @Date: 2021/11/29 19:56
 * @Description: $end$
 * @Version: V1.0
 */
@ControllerAdvice
public class ExceptionController {
    private R r = new R();

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public R returnException(){
     r.setCode(500);
     r.setMsg("出现异常，请联系管理员");
     return r;
    }

}
